package com.cgx.service;

import com.cgx.entity.message.Message;
import com.cgx.entity.message.Session;
import com.cgx.entity.message.SessionUser;
import com.cgx.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

@FeignClient("live-chat-web-message")
public interface MessageService {

    @GetMapping(value = "/live-chat/session/findAllSessionByUserId", consumes = MediaType.APPLICATION_JSON_VALUE)
    List<Session> findAllSessionByUserId(@RequestBody String fromUserId);

    @GetMapping(value = "/live-chat/session/saveAllSession", consumes = MediaType.APPLICATION_JSON_VALUE)
    List<Session> saveAllSession(@RequestBody List<Session> sessionList);

    @GetMapping(value = "/live-chat/session/saveAllSessionUser", consumes = MediaType.APPLICATION_JSON_VALUE)
    List<SessionUser> saveAllSessionUser(@RequestBody List<SessionUser> sessionUserList);

    @GetMapping(value = "/live-chat/message/saveAll", consumes = MediaType.APPLICATION_JSON_VALUE)
    Map<String, ResultVo> saveAllMessage(@RequestBody List<Message> messageList);
}
